@xenosystem/blocks 0.20.0 → 0.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.js +6 -1
- package/dist/chunk-5VOA3OSG.js +688 -0
- package/dist/chunk-HDP35LGH.js +0 -0
- package/dist/chunk-NFOBZJDF.js +600 -0
- package/dist/docs/core.d.ts +300 -0
- package/dist/docs/core.js +70 -0
- package/dist/docs/format.d.ts +145 -0
- package/dist/docs/format.js +44 -0
- package/dist/docs/index.d.ts +6 -441
- package/dist/docs/index.js +35 -1239
- package/package.json +217 -209
package/dist/auth/index.d.ts
CHANGED
|
@@ -252,6 +252,12 @@ interface XenoAuthGateState {
|
|
|
252
252
|
message?: string;
|
|
253
253
|
/** For `expired-offline`: when the licence was last confirmed, so the plate can say how long ago. */
|
|
254
254
|
lastVerifiedAt?: number;
|
|
255
|
+
/**
|
|
256
|
+
* The host name the system browser opens for sign-in (`xenosystem.ai`), as the HOST knows it — the gate
|
|
257
|
+
* does not. Named on the sign-in plate only when it is a plain host name; absent, the plate names no domain
|
|
258
|
+
* rather than guess one (apps sign in at different origins while the domain moves).
|
|
259
|
+
*/
|
|
260
|
+
signInHost?: string;
|
|
255
261
|
/** Which intents the host implements. A missing one hides its affordance (COMPONENTS §1.7). */
|
|
256
262
|
capabilities?: Partial<Record<XenoAuthGateIntentKind, boolean>>;
|
|
257
263
|
}
|
package/dist/auth/index.js
CHANGED
|
@@ -131,6 +131,11 @@ import { useEffect, useState } from "react";
|
|
|
131
131
|
import { AuthDoor, SignInForm } from "@xenosystem/components/auth";
|
|
132
132
|
|
|
133
133
|
// src/auth/gate/behaviour.ts
|
|
134
|
+
var HOST = /^(?=.{3,253}$)[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$/i;
|
|
135
|
+
function signInNote(signInHost, productName) {
|
|
136
|
+
const where = signInHost && HOST.test(signInHost) ? `at ${signInHost.toLowerCase()}` : "to sign in";
|
|
137
|
+
return `Your browser opens ${where}, where you can continue with Google, GitHub or email. ${productName} never sees your password.`;
|
|
138
|
+
}
|
|
134
139
|
function authGateView(state, productName, now = Date.now()) {
|
|
135
140
|
const phase = deriveAuthGatePhase(state);
|
|
136
141
|
const copy = plateCopy(phase, productName, state.message, formatSince(state.lastVerifiedAt, now));
|
|
@@ -159,7 +164,7 @@ function authGateView(state, productName, now = Date.now()) {
|
|
|
159
164
|
tag: copy.tag,
|
|
160
165
|
title: copy.title,
|
|
161
166
|
body: copy.body,
|
|
162
|
-
note: phase === "sign-in" && !state.pending ?
|
|
167
|
+
note: phase === "sign-in" && !state.pending ? signInNote(state.signInHost, productName) : void 0,
|
|
163
168
|
warning: copy.note,
|
|
164
169
|
identity: state.identity && phase !== "sign-in" ? state.identity.email ?? state.identity.name ?? state.identity.sub : void 0,
|
|
165
170
|
actions
|